<template>
    <a-drawer
      :maskClosable="false"
      :title="title"
      :width="width"
      placement="right"
      :closable="false"
      @close="close"
      :visible="visible">
      <ErpOmcContractApplicationForm ref="realForm" @ok="submitCallback" @unButtonDisable="unButtonDisable" :disabled="disableSubmit" normal></ErpOmcContractApplicationForm>
      <div class="drawer-footer">
        <CommonDrawerFooterButton
          startProcess="erpOmcContractManager: startProcess"
          :disableSubmit="disableSubmit"
          :buttonDisable="buttonDisable"
          @handleCancel="handleCancel"
          @handleOk="handleOk"
          @beginProcess="beginProcess"
        ></CommonDrawerFooterButton>
      </div>
    </a-drawer>
  </template>
  
  <script>
  
    // import ErpOmcContractManagerForm from './ErpOmcContractManagerForm'
    import ErpOmcContractApplicationForm from './ErpOmcContractApplicationForm'
    import CommonDrawerFooterButton from '@/views/components/CommonDrawerFooterButton.vue';
    import { ModalClickMixin } from '@/mixins/ModalClickMixin'
    export default {
      name: 'ErpOmcContractApplicationModel',
      components: {
        ErpOmcContractApplicationForm,
        CommonDrawerFooterButton
      },
      mixins: [ModalClickMixin],
      methods: {
        add (type) {
          this.buttonDisable = false
          this.visible = true
          this.$nextTick(() => {
            this.$refs.realForm.detailFlag = false; // 是否为查看详情
            this.$refs.realForm.add(type);
          })
        },
        add2 (type) {
          this.buttonDisable = false
          this.visible = true
          this.$nextTick(() => {
            this.$refs.realForm.detailFlag = false; // 是否为查看详情
            this.$refs.realForm.add2(type);
          })
        },
        edit (record) {
          this.buttonDisable = false
          this.visible = true
          this.$nextTick(() => {
            this.$refs.realForm.detailFlag = false; // 是否为查看详情
            this.$refs.realForm.edit(record);
          });
        }
      }
    }
  </script>
  
  <style lang="less" scoped>
  /** Button按钮间距 */
    .ant-btn {
      margin-left: 30px;
      margin-bottom: 30px;
      float: right;
    }
    .drawer-footer{
      position: absolute;
      bottom: -8px;
      width: 100%;
      border-top: 1px solid #e8e8e8;
      padding: 10px 16px;
      text-align: right;
      left: 0;
      background: #fff;
      border-radius: 0 0 2px 2px;
      z-index: 999;
    }
  </style>
  